<style type="text/css">
    .bjui-pageHeader {
        font-size: 18px;
        font-weight: bold;
    }

    .form {
        padding: 15px;
    }

    .form dl {
        overflow: hidden;
        padding-top: 15px;
    }

    .form dt {
        color: #666;
        float: left;
        font-size: 14px;
        padding: 3px 0 0;
        width: 11%;
    }

    .form dd {
        float: left;
        line-height: 22px;
    }

    dd.desc {
        height: 30px;
        padding: 0 10px;
        width: 150px;
    }

    fieldset {
        margin-top: 5px;
        margin-left: 5px;
        padding: 5px;
    }
</style>
<div class="bjui-pageHeader">
    <!-- 分页使用FORM -->
    <if condition='ACTION_NAME eq "index"'>
        <form action="{:U('Article/index',array('pid'=>$pid,'model'=>$model))}" method="post" novalidate="novalidate"
              data-toggle="ajaxsearch" id="pagerForm">
            <else/>
            <form action="{:U('Article/trach',array('pid'=>$pid,'model'=>$model))}" method="post" novalidate="novalidate"
                  data-toggle="ajaxsearch" id="pagerForm">
    </if>
    <!-- 分页使用FORM -->
    <!-- -->
    <input type="hidden" value="15" name="pageSize">
    <input type="hidden" value="{$nowPage}" name="pageCurrent">
    <input type="hidden" value="id" name="orderField">
    <input type="hidden" value="desc" name="orderDirection">
    <input type="hidden" value="{$model}" name="model">

    <!-- -->
    <input type="hidden" name="pid" value="{$pid}">

    <div class="bjui-searchBar">
        <if condition="$subcate">
            <fieldset>
                <legend>子栏目</legend>

                <foreach name='subcate' item='v'>
                    <a href="{:U('Article/index', array('pid' =>
                        $v['id'],'model'=>$v['tablename']))}" data-toggle="navtab" data-id="sub-article-index" data-title="{$v.name}">{$v.name}
                    </a>&nbsp;&nbsp;&nbsp;
                </foreach>
            </fieldset>
        </if>
        <if condition='ACTION_NAME eq "index"'>


            <button type="button" data-url="{:U('Article/add', array('pid'=>
                $pid,'model'=>$model))}" class="btn btn-default" data-toggle="navtab" data-id="article-add"
                    data-reload-warn="已打开添加文章页面，确认将重新载入?" data-title="添加内容" data-icon="plus">添加内容
            </button>
            <button type="button" class=" btn-default" data-icon="remove" data-confirm-msg="确实要删除选择项吗？"
                    data-toggle="doajax" data-url="{:U('Article/del')}?id={#bjui-selected}&pid={$pid}&model={$model}">删除
            </button>
            <button type="button" class="btn btn-default" data-url="{:U('Article/trach',array('pid' =>$pid,'model'=>$model))}"
                    data-toggle="navtab" data-id="article-trach">回收站
            </button>

            <input type="text" name="keyword" class="form-control" title="关键字" value="{$keyword}">
            <button data-icon="search" class="btn btn-default" type="submit">查询</button>
            <a data-icon="undo" data-clear-query="true" data-toggle="reloadsearch" href="javascript:;"
               class="btn btn-orange">清空查询</a>

            <else/>
            <button type="button" class="btn-default" data-icon="mail-reply" data-confirm-msg="确实要还原选择项吗？" data-toggle="doajax"
                data-url="{:U('Article/restore')}?id={#bjui-selected}&pid={$pid}&model={$model}">还原选择项
            </button>
            <button type="button" class="btn-default" data-icon="close" data-confirm-msg="确实要彻底删除选择项吗？" data-toggle="doajax"
                    data-url="{:U('Article/clear')}?id={#bjui-selected}&pid={$pid}&model={$model}">彻底删除选择项
            </button>

        </if>
    </div>
    </form>

</div>
<div class="bjui-pageContent">

    <form id="form_do" action="{:U('Article/del',array('pid'=>$pid))}" method="post" data-toggle="validate">
        <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true">
            <thead>
            <tr>
                <!--
                <th>

                    <input type="checkbox" class="checkboxCtrl" data-group="id[]" data-toggle="icheck"></th> -->
                <th>编号</th>
                <th>标题</th>
                <th>分类</th>
                <th>点击次数</th>
                <th>发布时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name='vlist' item='v'>
                <tr data-id="{$v.id}">
            <!--
                    <td>
                        <input type="checkbox" name="id[]" data-toggle="icheck" value="{$v.id}"></td>  -->
                        <?php
                            $cate_name_ename=getCateNameAndEnameById($v['cid']);
                        ?>
                    <td>{$v.id}</td>
                    <td class="aleft" style="color:{$v.color}">
                        {$v.title}
                        <if condition="$v.flag gt 0">
                            <span style="color:#079B04;">[{$v.flag|get_flags}]</span>
                        </if>
                    </td>
                    <td>{$cate_name_ename.name}</td>
                    <td>{$v.click}</td>
                    <td>{$v.publishtime|date='Y-m-d H:i:s', ###}</td>
                    <td>
                        <if condition='ACTION_NAME eq "index"'>

                            <if condition="($v.flag & B_JUMP) && !empty($v['jumpurl']) ">
                                <a href="{$v.jumpurl|goLinkEncode}" target="_blank">查看</a>
                                <else/>
                                <?php
                                
                               
                    $url=getContentUrl($v['id'],$v['cid'],$cate_name_ename['ename'],false,$v['jumpurl']);
                    $url=C('cfg_weburl').str_replace("/".C('cfg_hou_tai'),'',$url);
                ?>
                                <a href="{$url}" target="_blank">查看</a>
                            </if>
                            <a href="{:U('Article/edit',array('id' =>$v['id'],'pid' => $pid,'model'=>$model))}" data-toggle="navtab"
                               data-id="article-edit" data-reload-warn="已打开编辑页面，确认将重新载入?" data-title="修改内容">编辑
                            </a>
                            <a href="{:U('Article/del',array('id' =>$v['id'], 'pid' => $pid,'model'=>$model))}" data-toggle="doajax"
                               data-confirm-msg="确定要删除吗？" data-type="get">删除
                            </a>
                            <else/>
                            <a href="{:U('Article/restore',array('id'=>$v['id'],'pid'=>$pid,'model'=>$model))}" data-toggle="doajax"
                               data-confirm-msg="确定要还原吗？" data-type="get">还原</a>
                            <a href="{:U('Article/clear',array('id'=>$v['id'],'pid' => $pid,'model'=>$model))}" data-toggle="doajax"
                               data-confirm-msg="确定要彻底删除吗？" data-type="get">彻底删除</a>
                        </if>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>

        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="15">15</option>
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="100">100</option>
            </select>
        </div>
        <span>&nbsp;条，共 {$totalRows} 条</span>
    </div>

    <div class="pagination-box" data-toggle="pagination" data-total="{$totalRows}" data-page-size="15"
         data-page-current="{$nowPage}"></div>


</div>